package com.qcrud.core;

import java.util.Collections;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class SqlManager {
    private static final Map<String, SqlMetaData> sqlMetaDataMap = new ConcurrentHashMap<>();

    public static SqlMetaData put(String key, SqlMetaData sqlMetaData) {
        return sqlMetaDataMap.put(key, sqlMetaData);
    }

    public static SqlMetaData get(String key) {
        return sqlMetaDataMap.get(key);
    }

    /**
     * 返回一个不可修改的 MdSqlMap
     */
    public static Map<String, SqlMetaData> getSqlMetaDataMap() {
        return Collections.unmodifiableMap(sqlMetaDataMap);
    }

}
